
package org.springblade.common.enums.rate;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 事件类型
 */
@Getter
@AllArgsConstructor
public enum EventTypeEnum {

	GOOD("优秀事件",0),
	BAD("批评事件",1),
	;

	final String keyword;
	final Integer key;

	public static EventTypeEnum getEnum(String keyword) {
		if (keyword == null) {
			return null;
		} else {
			for (EventTypeEnum s : EventTypeEnum.values()) {
				if (s.getKeyword().equals(keyword)) {
					return s;
				}
			}
			return null;
		}
	}
	public static EventTypeEnum getEnum(Integer key) {
		if (key == null) {
			return null;
		} else {
			for (EventTypeEnum s : EventTypeEnum.values()) {
				if (s.getKey().equals(key)) {
					return s;
				}
			}
			return null;
		}
	}

}
